package May15ch16ex3;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class MyFilters {
	public static void main(String[] args) throws IOException {
		File outFile = new File("outputex3.bin");
		outFile.createNewFile();
		InputStream in = new FileInputStream("input.bin");
		InputStream shiftIn = new ShiftInputStream(in, 1);

		OutputStream out = new FileOutputStream(outFile);
		Integer data = null;

		while ((data = shiftIn.read()) != -1) {
			System.out.println(data);
			System.out.println((char) data.intValue());
			out.write(data);
		}
		in.close();
		out.close();

	}
}
